<%@page import="java.util.List"%>
<%@page import="java.util.Collections"%>
<%@page import="java.util.Arrays"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Mostra internazionale felina</title>
</head>
<body>
	<%
		response.setIntHeader("Refresh", 20);
	%>
	<img alt="" width="20%" src="images/anfi01.jpg">
	<div
		style="width: 100%; height: 70px; text-align: center; font-size: 2em; margin-top: -50px;">
		<B>MOSTRA INTERNAZIONALE FELINA </br> DI TRENTO - 17/18 NOVEMBRE
		</B>
	</div>

	<div style="width: 100%; height: 30px;">
	</div>


	<div style="width: 100%; height: 50px;">
		<%
			String notes = (String) request.getAttribute("notes");
		%>
		<font size="5">
			<marquee direction="left"  HEIGHT="50" align="middle" >
				<%
					out.println(notes);
				%>
			</marquee>
		</font>
	</div>

	<table style="width: 100%;">
		<tr align="center">
			<%
				HashMap data = (HashMap) request.getAttribute("numbers");
				Iterator iterator = data.keySet().iterator();
				List sortedKeys = new ArrayList(data.keySet());
				Collections.sort(sortedKeys);

				String key;

				for (int j = 0; j < sortedKeys.size(); j++) {
			%><TD style="vertical-align: top;"><table>
					<%
						//key = (String) iterator.next();
							key = (String) sortedKeys.get(j);
							String nomeGiudice;
							if (key.endsWith(":NOM")) {
								nomeGiudice = key.substring(0, key.indexOf(":NOM"));
							} else
								nomeGiudice = key;
					%><tr align="center">
						<TD>
							<DIV style="font-size:1.5em;font-weight:bold;">
								<%
									out.println(nomeGiudice);

										if (key.endsWith(":NOM")) {
								%>
								</br><blink>NOM</blink>
								<%
									}
								%>
							</DIV>
						</TD>
					</tr>
					<%
						ArrayList<Integer> numbersArray = (ArrayList<Integer>) data
									.get(key);
					%>
					<%
						for (int i = 0; i < numbersArray.size(); i++) {
					%>
						<tr align="center">	
							<%
							if (!key.endsWith(":NOM")) {
								if (i > 0 && i <= 10) {
									if (i <= 4) {
							%>
							<td bgcolor="#FE2E2E">
								<%
									} else if (i > 4 && i <= 7) {
								%>
							
							<td bgcolor="#FACC2E">
								<%
									} else {
								%>
							
							<td bgcolor="#006600">
								<%
									}
								%>
								<DIV style="font-size:2em;font-weight:bold;">
									<%
										out.println(numbersArray.get(i));
												}
							}
							
							
							else{
								%>
								<td bgcolor="#FE2E2E">
									<DIV style="font-size:2em;font-weight:bold;">
										<blink>
										<%
											out.println(numbersArray.get(i));
							}
									%>
									</blink>
								</div>
							</td>
						</tr>
					<%
						}
					%>
				</table></td>
			<%
				}
			%>
		
	</table>
	<td>
	</tr>
	</table>
</body>
</html>